package com.codeforces.contest.c298;
import java.util.Scanner;


public class _298A {

	static Scanner scanner = new Scanner(System.in);
	static int n, from, to;
	static String s;

	public static void main(String[] args) {
		n = scanner.nextInt();
		s = scanner.next();
		for (int i=0;i<n;++i) {
			if (s.charAt(i) == '.') {
				continue;
			}
			else if (s.charAt(i) == 'R') {
				from = i+1;
				for (int j=i+1;j<n;++j) {
					if (s.charAt(j) == 'L') {
						to = j;
						System.out.println(from + " " + to);
						return;
					}
					else if (s.charAt(j) == '.') {
						to = j+1;
						System.out.println(from + " " + to);
						return;
					}
				}
			}
			else {
				to = i;
				for (int j=i+1;j<n;++j) {
					if (s.charAt(j) == '.') {
						from = j;
						System.out.println(from + " " + to);
						return;
					}
				}
				return;
			}
		}
	}

}
